home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / admin / validate.php < prev   
Encoding:
PHP Script  |  2002-10-28  |  4.4 KB  |  168 lines

  1. <?
  2. // *******************************************************************
  3. //  admin/validate.php
  4. // *******************************************************************
  5.  
  6. include("../include/config.php");
  7. include("../include/functions.php");
  8. include("../include/lang/$language.php");
  9. include("../include/session.php");
  10. session_start();
  11. ?>
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  13. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  14. <html>
  15. <head>
  16. <title></title>
  17. <link rel = "stylesheet" type = "text/css" href = "style.css" />
  18. </head>
  19. <?=$adm_body?><?
  20.  
  21. if(isset($validate_site) && isset($ID)){
  22.     
  23.     $insert = sql_query("
  24.         insert into $tb_links (
  25.             ID,
  26.             SiteName,
  27.             SiteURL,
  28.             Description,
  29.             Category,
  30.             Country,
  31.             Email,
  32.             LastUpdate,
  33.             Added,
  34.             UserName,
  35.             Password,
  36.             Hint
  37.         ) values (
  38.             '',
  39.             '$SiteName',
  40.             '$SiteURL',
  41.             '$Description',
  42.             '$Category',
  43.             '$Country',
  44.             '$Email',
  45.             now()+0,
  46.             now()+0,
  47.             '$UserName',
  48.             '$Password',
  49.             '$Hint'
  50.         )"
  51.     );
  52.  
  53.     $id = sql_insert_id();
  54.  
  55.     $delete = sql_query("
  56.         delete from
  57.             $tb_temp
  58.         where
  59.             ID='$ID'
  60.     ");
  61.  
  62.     if($email_addition == "Y"){
  63.         include("../include/email_confirmation.php");
  64.     }
  65.  
  66. ?><table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  67.     <tr>
  68.         <td class="theader" align="center">Site has been validated.<br /><br /><?
  69.  
  70.         $temp_sites = sql_query("
  71.             select
  72.                 *
  73.             from
  74.                 $tb_temp
  75.         ");
  76.  
  77.         if(sql_num_rows($temp_sites)>0){
  78.             ?><a 
  79.             href="sites_main.php?<?=session_name()?>=<?=session_id()?>&submit=1&Category=-1">Validate More Sites</a><?
  80.         } else {
  81.             ?><a 
  82.             href="main.php?<?=session_name()?>=<?=session_id()?>&submit=1&Category=-1">No More Sites to Validate</a><?
  83.         }
  84.         ?></td>
  85.     </tr>
  86.     </table>
  87.     
  88.     <br /><?
  89.     }
  90.  
  91. if(isset($ID) && !isset($validate_site))
  92. {
  93.     $get_site = sql_query("select * from $tb_temp where ID='$ID'");
  94.     $rows = sql_fetch_array($get_site);
  95.     ?>
  96.     <table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  97.     <tr>
  98.         <form method="post" action="validate.php?<?=session_name()?>=<?=session_id()?>">
  99.         <input type="hidden" name="UserName" value="<?=$rows[UserName]?>">
  100.         <input type="hidden" name="Password" value="<?=$rows[Password]?>">
  101.         <input type="hidden" name="Hint" value="<?=$rows[Hint]?>">
  102.         <input type="hidden" name="ID" value="<?=$rows[ID]?>">
  103.         <td colspan="2" class="theader"><table cellpadding="0" cellspacing="0" border="0" width="100%">
  104.         <tr>
  105.             <td class="theader">Validate Site</td>
  106.             <td align="right">[ <a href="<?=$rows[SiteURL]?>" target="_blank">View Site</a> ] [ <a href="delete_site.php?<?=session_name()?>=<?=session_id()?>&table=temp&ID=<?=$rows[ID]?>">Delete</a> ]</td>
  107.         </tr>
  108.         </table></td>
  109.     </tr>
  110.     <tr>
  111.         <td class="text">Site Name:</td>
  112.         <td><input class="small" class="small" type="text" name="SiteName" 
  113.         value="<?=stripslashes($rows[SiteName])?>" size="35"></td>
  114.     </tr>
  115.     <tr>
  116.         <td class="text">Site URL:</td>
  117.         <td><input class="small" type="text" name="SiteURL" 
  118.         value="<?=$rows[SiteURL]?>" size="35"></td>
  119.     </tr>
  120.     <tr>
  121.         <td class="text">Description:</td>
  122.         <td><textarea class="small" name="Description" rows="7" 
  123.         cols="40"><?=stripslashes($rows[Description])?></textarea></td>
  124.     </tr>
  125.     <tr>
  126.         <td class="text">Category: </td>
  127.         <td><select class="small" name="Category"><?
  128.         drop_cats($rows[Category], 0, "", $cats);
  129.         echo $cats;
  130.         ?></select></td>
  131.     </tr>
  132.     <tr>
  133.         <td class="text">Country: </td>
  134.         <td><select class="small" class="textBox" name="Country"><?
  135.         if($d = dir("../images/flags"))
  136.         {
  137.             echo getFlagList("../images/flags", $rows[Country]);
  138.         }
  139.         ?></select></td>
  140.     </tr>
  141.     <tr>
  142.         <td class="text">Email</td>
  143.         <td><input class="small" type="text" name="Email" 
  144.         value="<?=$rows[Email]?>" size="35"></td>
  145.     </tr>
  146.     <tr>
  147.         <td colspan="2" align="center"><input class="button" type="submit" 
  148.         name="validate_site" value=" Validate Site "></td>
  149.     </form></tr>
  150.     </table>
  151.     <?
  152. }
  153.  
  154. if(!isset($ID) && !isset($validate_site))
  155. {
  156.     ?><table cellspacing="0" cellpadding="5" border="1" align="center" width="100%">
  157.     <tr>
  158.         <form method="post" action="validate.php?<?=session_name()?>=<?=session_id()?>">
  159.         <td class="theader">Please enter a site ID: <input class="small" type="text" name="ID" size="5">
  160.         <input class="button" type="submit" name="submit" value=" Validate Site "></td>
  161.         </form>
  162.     </tr>
  163.     </table><?
  164. }
  165. ?>
  166. </body>
  167. </html>
  168.